import { ref } from 'vue'
import { onReady } from '@dcloudio/uni-app'
import { getArticle } from '@/api'

/**
 * 文章 hooks
 */
export const useArticle = (categoryType) => {
  // 页面内容
  const articleList = ref([])

  onReady(async () => {
    const list = await getArticle(categoryType)
    articleList.value = list
  })

  return { articleList }
}

